home *** CD-ROM | disk | FTP | other *** search
/ PC Users 1998 November / Cd users extra 14.iso / prog / inst / mailc / see4c_r.txt < prev    next >
Encoding:
Text File  |  1998-09-14  |  30.3 KB  |  1,082 lines

  1.  
  2.  
  3.  
  4.  
  5.                          SMTP/POP3 Email Engine
  6.  
  7.                            Library for C/C++
  8.  
  9.                                  (SEE4C)
  10.  
  11.  
  12.                             REFERENCE MANUAL
  13.  
  14.  
  15.  
  16.                                Version 2.0
  17.  
  18.                             September 14, 1998
  19.  
  20.  
  21.  
  22.  
  23.                      This software is provided as-is.
  24.               There are no warranties, expressed or implied.
  25.  
  26.  
  27.  
  28.  
  29.                            Copyright (C) 1998
  30.                            All rights reserved
  31.  
  32.  
  33.  
  34.                        MarshallSoft Computing, Inc.
  35.                            Post Office Box 4543
  36.                            Huntsville AL 35815
  37.  
  38.  
  39.                            Voice : 256-881-4630
  40.                              FAX : 256-880-0925
  41.                            email : info@marshallsoft.com
  42.                              web : www.marshallsoft.com
  43.  
  44.                                _______
  45.                           ____|__     |                (R)
  46.                        --+       |    +-------------------
  47.                          |   ____|__  |  Association of
  48.                          |  |       |_|  Shareware
  49.                          |__|   o   |    Professionals
  50.                        --+--+   |   +---------------------
  51.                             |___|___|    MEMBER
  52.  
  53.  
  54.       MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.      SEE4C Reference Manual                                    Page 1
  61.  
  62.                             C O N T E N T S
  63.  
  64.  
  65.  
  66.         Chapter                                     Page
  67.  
  68.         Table of Contents.............................2
  69.  
  70.         General Remarks...............................3
  71.  
  72.         SEE Functions.................................3
  73.  
  74.            seeClose...................................3
  75.  
  76.            seeDeleteEmail.............................4
  77.  
  78.            seeDriver..................................5
  79.  
  80.            seeErrorText...............................6
  81.  
  82.            seeExtractText.............................7
  83.  
  84.            seeGetEmailCount...........................8
  85.  
  86.            seeGetEmailFile............................9
  87.  
  88.            seeGetEmailLines..........................10
  89.  
  90.            seeGetEmailSize...........................11
  91.  
  92.            seeIntegerParam...........................12
  93.  
  94.            seePop3Connect............................13
  95.  
  96.            seeSendEmail..............................14
  97.  
  98.            seeSmtpConnect............................15
  99.  
  100.            seeStatistics.............................16
  101.  
  102.            seeStringParam............................17
  103.  
  104.            seeVerifyFormat...........................18
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      SEE4C Reference Manual                                    Page 2
  121.  
  122.       General Remarks
  123.  
  124.       All functions return an integer code. Negative values are always
  125.       errors. See Section 10.3 "SEE Error Return Code List" in the
  126.       SEE/POP3 Users Manual (SEE4C_U.TXT). Non-negative return codes are
  127.       never errors.
  128.  
  129.       Allocate all buffers passed to SEE statically, rather than
  130.       dynamically on the stack. You can always force any variable
  131.       declaration to be staticly allocated by use of the "static" keyword,
  132.       for example:
  133.  
  134.           static char Buffer[64];
  135.  
  136.  
  137.       SEE Functions
  138.  
  139.  
  140.       +----------+--------------------------------------------------------+
  141.       | seeClose | Closes SMTP/POP3 Email Engine.                         |
  142.       +----------+--------------------------------------------------------+
  143.  
  144.  
  145.         SYNTAX  int seeClose(void)
  146.  
  147.        REMARKS  The seeClose function closes the connection created by
  148.                 calling seeSmtpConnect or seePop3Connect. seeSmtpConnect or
  149.                 seePop3Connect can be called again to open a connection to
  150.                 another SMTP or POP3 server if desired.
  151.  
  152.                 SEE can not be connected to both the SMTP server and the
  153.                 POP3 server at the same time. Call seeClose to terminate
  154.                 the connection before connecting again.
  155.  
  156.        RETURNS  < 0 : An error has occurred. See the error list.
  157.  
  158.        EXAMPLE
  159.  
  160.                 // call after sending all email.
  161.  
  162.                 seeClose();
  163.  
  164.       ALSO SEE  seeSmtpConnect and seePop3Connect.
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      SEE4C Reference Manual                                    Page 3
  181.  
  182.  
  183.       +----------------+--------------------------------------------------+
  184.       | seeDeleteEmail | Deletes email from Server.                       |
  185.       +----------------+--------------------------------------------------+
  186.  
  187.  
  188.         SYNTAX  int seeDeleteEmail(
  189.                       int MsgNbr)    // message number
  190.  
  191.  
  192.        REMARKS  The seeDeleteEmail function deletes the email numbered
  193.                 'MsgNbr' from the server.
  194.  
  195.                 After each email deletion by the POP3 server, all messages
  196.                 are renumbered, the first message being 1. Therefore,
  197.                 delete messages from highest to lowest to avoid having to
  198.                 recalculate message numbering.
  199.  
  200.                 For example, to delete messages 5, 6, and 7, message 7 is
  201.                 deleted first, then message 6, and lastly message 5.
  202.  
  203.                 Be careful! Once an email has been deleted from the
  204.                 server, it cannot be recovered.
  205.  
  206.        RETURNS  < 0 : An error has occurred. See the error list.
  207.  
  208.        EXAMPLE
  209.  
  210.                 int Code;
  211.                 . . .
  212.                 // delete message # 5 , # 6, and #7.
  213.                 Code = seeDeleteEmail(7);
  214.                 if(Code>=0) Code = seeDeleteEmail(6);
  215.                 if(Code>=0) Code = seeDeleteEmail(5);
  216.                 . . .
  217.  
  218.       ALSO SEE  seeGetEmailCount.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.      SEE4C Reference Manual                                    Page 4
  241.  
  242.  
  243.       +-----------+-------------------------------------------------------+
  244.       | seeDriver | Executes next SEE state.                              |
  245.       +-----------+-------------------------------------------------------+
  246.  
  247.  
  248.         SYNTAX  int seeDriver(void)
  249.  
  250.        REMARKS  The seeDriver function executes the next state in the SEE
  251.                 state engine. The purpose of this function is to allow the
  252.                 programmer to get control after the driver executes each
  253.                 state.
  254.  
  255.                 The seeDriver function is explicitly called only after the
  256.                 AUTO_DRIVER_CALL flag has been disabled (see function
  257.                 seeIntegerParam). If the AUTO_DRIVER_CALL flag has not been
  258.                 disabled (the default), then seeDriver is never called.
  259.  
  260.                 Refer to the section 4.0 "Theory of Operation" in the
  261.                 SMTP/POP3 Users Manual for more details on the operation of
  262.                 seeDriver.
  263.  
  264.        RETURNS  = 0 : The driver is done.
  265.                 < 0 : An error has occurred. See the error list.
  266.                 > 0 : The returned value is the state just executed.
  267.  
  268.        EXAMPLE
  269.  
  270.                 int Code;
  271.                 . . .
  272.                 [call seeSmtpConnect]
  273.                 . . .
  274.                 // disable automatic calling of seeDriver().
  275.                 seeIntegerParam(AUTO_DRIVER_CALL, 0);
  276.                 Code = seeSendEmail(...);
  277.                 if(Code<0)
  278.                   {printf("Error %d\n", Code);
  279.                    exit(1);
  280.                   }
  281.                 while(1)
  282.                   {Code = seeDriver();
  283.                    if(Code<0)
  284.                      {printf("Error %d\n", Code);
  285.                       exit(1);
  286.                      }
  287.                    /* display all but "wait" state */
  288.                    if(Code!=9999) printf("%d ",Code);
  289.                    if(Code==0) return 0;
  290.                   }
  291.                }
  292.  
  293.       ALSO SEE  seeIntegerParam, seeSmtpConnect, and seePop3Connect.
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.      SEE4C Reference Manual                                    Page 5
  301.  
  302.  
  303.       +--------------+----------------------------------------------------+
  304.       | seeErrorText | Get text associated with error code.               |
  305.       +--------------+----------------------------------------------------+
  306.  
  307.  
  308.         SYNTAX  int seeErrorText(
  309.                       int Code,     // Error code returned by SEE function.
  310.                       LPSTR Buffer, // Buffer to place error text into.
  311.                       int BufLen)   // Length of above Buffer.
  312.  
  313.        REMARKS  The seeErrorText function is used to get the error text
  314.                 associated with an an error code as returned by one of the
  315.                 other SEE functions.
  316.  
  317.                 When an error occurs, seeErrorText can be used to get the
  318.                 error text so that it can be displayed for the user.
  319.  
  320.        RETURNS  < 0 : An error has occurred. See the error list.
  321.                 >=0 : Error message was copied into 'Buffer'.
  322.  
  323.        EXAMPLE
  324.  
  325.                 static char Buffer[80];
  326.  
  327.                 . . .
  328.  
  329.                 Code = seeSmtpConnect(
  330.                           "mail.myisp.net",   // SMTP server
  331.                           "<me@myisp.net>",   // your email address
  332.                           NULL);              // reply-to
  333.                 if(Code<0)
  334.                   {seeErrorText(Code,Buffer,80);
  335.                    printf("ERROR %d: %s\n", Code, Buffer);
  336.                    exit(1);
  337.                   }
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      SEE4C Reference Manual                                    Page 6
  361.  
  362.  
  363.       +----------------+--------------------------------------------------+
  364.       | seeExtractText | Extract specified text from buffer.              |
  365.       +----------------+--------------------------------------------------+
  366.  
  367.  
  368.         SYNTAX  int seeExtractText(
  369.                       LPSTR Src,     // Text buffer to search.
  370.                       LPSTR Text,    // Text searching for.
  371.                       LPSTR Buffer,  // Buffer for line if found.
  372.                       int BufSize)   // Size of 'Buffer'.
  373.  
  374.        REMARKS  The seeExtractText function is used to search the text
  375.                 buffer 'Src' for text 'Text'. If found, the entire line is
  376.                 copied to 'Buffer', up to a maximum of 'BufSize' bytes.
  377.  
  378.                 The primary purpose of seeExtractText is to extract header
  379.                 lines from the buffer after calling seeGetEmailLines.
  380.  
  381.                 The seeExtractText does not require a connection to a SMTP
  382.                 or POP3 server.
  383.  
  384.                 For an example of use, see the STATUS and FROM sample
  385.                 programs.
  386.  
  387.        RETURNS  1 (TRUE) if 'Text' was found
  388.                 0 (FALSE) if 'Text' was not found.
  389.  
  390.        EXAMPLE
  391.  
  392.                 // search 'Source' for the line containing "From:"
  393.                 Code = seeExtractText((LPSTR)Source,(LPSTR)"From: ",
  394.                                       (LPSTR)Temp, 80);
  395.                 // print line if found
  396.                 if(Code>0) printf("%s\n", Temp);
  397.  
  398.       ALSO SEE  seeGetEmailLines.
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.      SEE4C Reference Manual                                    Page 7
  421.  
  422.  
  423.       +------------------+------------------------------------------------+
  424.       | seeGetEmailCount | Get number of email messages on server.        |
  425.       +------------------+------------------------------------------------+
  426.  
  427.  
  428.         SYNTAX  int seeGetEmailCount(void)
  429.  
  430.        REMARKS  The seeGetEmailCount function returns the number of
  431.                 messages waiting on the server, independent of whether
  432.                 they have been previously read.
  433.  
  434.                 If you have disabled the driver AUTO_CALL capability,
  435.                 the message count must be found by
  436.  
  437.                    Count = SioStatistics(SEE_GET_MSG_COUNT)
  438.  
  439.                 after calling SioDriver until it returns 0. Refer to the
  440.                 STAT and STATUS sample program for examples of use.
  441.  
  442.        RETURNS  < 0 : An error has occurred. See the error list
  443.                 >=0 : The number of email messages waiting (if AUTO_CALL
  444.                       was disabled).
  445.  
  446.        EXAMPLE
  447.  
  448.                 /* connect to POP3 server */
  449.                 Code = seePop3Connect(
  450.                    (LPSTR)"mail.myisp.net",   // POP3 server
  451.                    (LPSTR)"billbob",          // user
  452.                    (LPSTR)"xxx");             // password
  453.  
  454.                 /* get # messages waiting  */
  455.                 Code = seeGetEmailCount();
  456.                 printf("%d messages waiting\n",Code);
  457.  
  458.       ALSO SEE  seeGetEmailLines.
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.      SEE4C Reference Manual                                    Page 8
  481.  
  482.  
  483.       +-----------------+-------------------------------------------------+
  484.       | seeGetEmailFile | Read email message & save to a file.            |
  485.       +-----------------+-------------------------------------------------+
  486.  
  487.  
  488.         SYNTAX  int seeGetEmailFile(
  489.                       int MsgNbr,       // header #
  490.                       LPSTR EmailName,  // email filename
  491.                       LPSTR EmailDir,   // directory for email
  492.                       LPSTR AttachDir)  // directory for attachments
  493.  
  494.        REMARKS  The seeGetEmailFile reads the email message 'MsgNbr',
  495.                 saving it to disk as filename 'EmailName' in directory
  496.                 'EmailDir', and saving MIME attachments to directory
  497.                 'AttachDir'. The current directory is specified as '.'.
  498.  
  499.        RETURNS  < 0 : An error has occurred. See the error list
  500.  
  501.        EXAMPLE
  502.  
  503.                 // read message 1 and save as MYMAIL.TXT in
  504.                 // current directory
  505.  
  506.                 Code = seeGetEmailFile(1, (LPSTR)"mymail.txt",
  507.                        (LPSTR)".", (LPSTR)".");
  508.  
  509.       ALSO SEE  seeGetEmailLines.
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.      SEE4C Reference Manual                                    Page 9
  541.  
  542.  
  543.       +------------------+------------------------------------------------+
  544.       | seeGetEmailLines | Read lines from email message.                 |
  545.       +------------------+------------------------------------------------+
  546.  
  547.  
  548.         SYNTAX  int seeGetEmailLines(
  549.                       int MsgNbr,   // message #
  550.                       int Lines,    // # lines
  551.                       LPSTR Buffer, // Pointer to (static) Buffer
  552.                       int Size)     // size of buffer
  553.  
  554.  
  555.        REMARKS  The seeGetEmailLines function reads all header lines plus
  556.                 the number of body lines specified by the 'Lines' argument
  557.                 into 'Buffer', up to a maximum of 'Size' bytes.
  558.  
  559.                 The primary purpose of this function is to read the header
  560.                 lines without having to read the entire message.
  561.  
  562.                 If you have disabled the driver AUTO_CALL capability,
  563.                 the size must be found by
  564.  
  565.                    Count = SioStatistics(SEE_GET_BUFFER_COUNT)
  566.  
  567.                 after calling SioDriver until it returns 0.
  568.  
  569.                 See the STATUS and FROM sample code for examples of use.
  570.  
  571.        RETURNS  < 0 : An error has occurred. See the error list.
  572.                 >=0 : The number of bytes read (if AUTO_CALL
  573.                       was disabled).
  574.  
  575.        EXAMPLE
  576.  
  577.                 char Buffer[1024];
  578.                 . . .
  579.                 /* read header lines for email # 1 */
  580.                 Code = seeGetEmailLines(1,0,(LPSTR)Buffer,1024);
  581.  
  582.       ALSO SEE  seeGetEmailFile
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.      SEE4C Reference Manual                                    Page 10
  601.  
  602.  
  603.       +-----------------+-------------------------------------------------+
  604.       | seeGetEmailSize | Get size of email message in bytes.             |
  605.       +-----------------+-------------------------------------------------+
  606.  
  607.  
  608.         SYNTAX  long seeGetEmailSize(
  609.                        int MsgNbr)   // message number
  610.  
  611.  
  612.        REMARKS  The seeGetEmailSize function returns the size in bytes of
  613.                 the specified message # 'MsgNbr'.
  614.  
  615.                 seeGetEmailSize returns the size of the entire email
  616.                 message, including any attachments. Note that attachments
  617.                 will be encoded (MIME, UUENCODE, etc.), and thus take up
  618.                 more room than after they are decoded.
  619.  
  620.                 If you have disabled the driver AUTO_CALL capability,
  621.                 the size must be found by
  622.  
  623.                    Count = SioStatistics(SEE_GET_MSG_SIZE)
  624.  
  625.                 after calling SioDriver until it returns 0.
  626.  
  627.                 See the READER sample code for an example of use.
  628.  
  629.        RETURNS  < 0 : An error has occurred. See the error list
  630.                 >=0 : The size of the email in bytes on the server
  631.                       (if AUTO_CALL was disabled).
  632.  
  633.        EXAMPLE  long FileSize;
  634.                 . . .
  635.                 /* get size of email message # 3 */
  636.                 FileSize = seeGetEmailSize(3);
  637.  
  638.  
  639.       ALSO SEE  seeGetEmailCount.
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.      SEE4C Reference Manual                                    Page 11
  661.  
  662.  
  663.       +-----------------+-------------------------------------------------+
  664.       | seeIntegerParam | Sets SEE integer parameter.                     |
  665.       +-----------------+-------------------------------------------------+
  666.  
  667.  
  668.         SYNTAX  int seeIntegerParam(
  669.                       int ParmIndex,    // Parameter index (see below).
  670.                       ULONG ParmValue)  // Value of parameter to set.
  671.  
  672.        REMARKS The seeIntegerParam is used to set an integer parameter as
  673.                 defined in SEE.H. For more information, refer to the Users
  674.                 Manual. All times are in milliseconds.
  675.  
  676.                         Parameter Name     Default
  677.                  SEE_MIN_RESPONSE_WAIT  :  500
  678.                  SEE_MAX_RESPONSE_WAIT  :  10000
  679.                      SEE_MIN_LINE_WAIT  :  5
  680.                      SEE_MAX_LINE_WAIT  :  10000
  681.                       SEE_CONNECT_WAIT  :  60000
  682.                   SEE_QUOTED_PRINTABLE  :  0
  683.                   SEE_AUTO_CALL_DRIVER  :  1
  684.  
  685.                 SEE_MIN_RESPONSE_WAIT is the delay before looking for the
  686.                 server's response.
  687.  
  688.                 SEE_MAX_RESPONSE_WAIT is the time after which a "time-out"
  689.                 error occurs if the server has not responded.
  690.  
  691.                 SEE_MIN_LINE_WAIT is the delay before checking if the
  692.                 server is ready to accept the next line of input.
  693.  
  694.                 SEE_MAX_LINE_WAIT is the time after which a "time-out"
  695.                 error is declared if the server has not responded.
  696.  
  697.                 SEE_CONNECT_WAIT is the maximum time allowed to complete a
  698.                 connection to the SMTP server.
  699.  
  700.                 SEE_QUOTED_PRINTABLE controls whether messages are (1)
  701.                 or are not (0) encoded as quoted-printable.
  702.  
  703.                 SEE_AUTO_CALL_DRIVER controls whether seeDriver is called
  704.                 automatically (to completion) after seeSmtpConnect or
  705.                 seePop3Connect has been called.
  706.  
  707.        EXAMPLE
  708.  
  709.                 /* disable auto call feature */
  710.                 seeIntegerParam(SEE_AUTO_CALL_DRIVER, 0);
  711.  
  712.       ALSO SEE  seeStringParam.
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.      SEE4C Reference Manual                                    Page 12
  721.  
  722.  
  723.       +----------------+--------------------------------------------------+
  724.       | seePop3Connect | Connects to POP3 Server.                         |
  725.       +----------------+--------------------------------------------------+
  726.  
  727.  
  728.         SYNTAX  int seePop3Connect(
  729.                       LPSTR Pop3Ptr,    // POP3 server name
  730.                       LPSTR UserPtr,    // POP3 user name.
  731.                       LPSTR PassPtr)    // POP3 password.
  732.  
  733.        REMARKS  The seePop3Connect function establishes a connection with
  734.                 the POP3 server as specified by the Server argument.
  735.  
  736.                 Your POP3 server name will typically be named
  737.                 "mail.XXX.com" where XXX is your email address, such as
  738.                 name@XXX.com. Your POP3 server name can also be found in
  739.                 the setup information for your normal email client, such as
  740.                 Eudora or Microsoft Outlook.
  741.  
  742.                 The POP3 server name can also be specified in dotted
  743.                 decimal notation if wanted. For example "10.23.231.1".
  744.  
  745.                 SEE can not be connected to both the SMTP server and the
  746.                 POP3 server at the same time. Call seeClose to terminate
  747.                 the connection before connecting again.
  748.  
  749.        RETURNS  < 0 : An error has occurred. See the error list.
  750.  
  751.        EXAMPLE
  752.  
  753.                 int Code;
  754.                 Code = seePop3Connect(
  755.                           (LPSTR)"mail.myisp.com",  // POP3 server
  756.                           (LPSTR)"billbob",         // user
  757.                           (LPSTR)"xxx");            // password
  758.  
  759.       ALSO SEE  seeSmtpConnect and seeClose.
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.      SEE4C Reference Manual                                    Page 13
  781.  
  782.  
  783.       +--------------+----------------------------------------------------+
  784.       | seeSendEmail | Sends email and attachments.                       |
  785.       +--------------+----------------------------------------------------+
  786.  
  787.  
  788.         SYNTAX  int seeSendEmail(
  789.                       LPSTR To,     // Recipient, separated by commas.
  790.                       LPSTR CC,     // CC list, separated by commas.
  791.                       LPSTR BCC,    // BCC list, separated by commas.
  792.                       LPSTR Subj,   // Subject text.
  793.                       LPSTR Msg,    // Message or message filename.
  794.                       LPSTR Attach) // File attachment.
  795.  
  796.        REMARKS  The seeSendEmail function is used to send email once a
  797.                 connection has been made to your SMTP server after calling
  798.                 seeSmtpConnect.
  799.  
  800.                 Note that all email addresses (in To, CC, and BCC strings)
  801.                 must be bracketed. For example:
  802.  
  803.                      <mike@marshallsoft.com>
  804.  
  805.                 The CC and BCC strings may contain multiple email
  806.                 addresses, separated by commas. For example:
  807.  
  808.                    "Billy Bob<bbob@isp.com>,Buster<bm@isp.com>"
  809.  
  810.                 If the first character of the message (fifth argument) is
  811.                 a '@', then it is considered as the filename which contains
  812.                 the message to send.
  813.  
  814.                 'Attach' may contain one or more attachments, separated by
  815.                 commas. For example,
  816.  
  817.                    "file1.zip,file2.doc".
  818.  
  819.        RETURNS  < 0 : An error has occurred. See the error list.
  820.  
  821.        EXAMPLE
  822.  
  823.               seeSendEmail("<myfriend@hisisp.com>",  /* recipient */
  824.                            NULL,                     /* CC list */
  825.                            NULL,                     /* BCC list */
  826.                            "Hello",                  /* subject */
  827.                            "Call me ASAP!",          /* message */
  828.                            NULL);                    /* attachment */
  829.  
  830.  
  831.       ALSO SEE  seeSmtpConnect.
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.      SEE4C Reference Manual                                    Page 14
  841.  
  842.  
  843.       +----------------+--------------------------------------------------+
  844.       | seeSmtpConnect | Connects to SMTP server.                         |
  845.       +----------------+--------------------------------------------------+
  846.  
  847.  
  848.         SYNTAX  int seeSmtpConnect(
  849.                       LPSTR Server,  // SMTP server.
  850.                       LPSTR From,    // Your email address in brackets.
  851.                       LPSTR ReplyTo) // Email address to reply to.
  852.  
  853.        REMARKS  The seeSmtpConnect function establishes a connection with
  854.                 the SMTP server as specified by the 'Server' argument.
  855.  
  856.                 Your SMTP server name will typically be named
  857.                 "mail.XXX.com" where XXX is your email address, such as
  858.                 name@XXX.com. Your SMTP server name can also be found in
  859.                 the setup information for your normal email client, such as
  860.                 Eudora or Microsoft Outlook.
  861.  
  862.                 The SMTP server name can also be specified in dotted
  863.                 decimal notation if wanted. For example "10.23.231.1".
  864.  
  865.                 The 'From' string is required and must be enclosed in "<>"
  866.                 brackets, such as <mike@marshallsoft.com>.
  867.  
  868.                 The 'ReplyTo' string is optional and is used for the
  869.                 "Reply-To:" header line. If used, the email address must be
  870.                 enclosed in "<>" brackets.
  871.  
  872.                 SEE can not be connected to both the SMTP server and the
  873.                 POP3 server at the same time. Call seeClose to terminate
  874.                 the connection before connecting again.
  875.  
  876.        RETURNS < 0 : An error has occurred. See the error list.
  877.  
  878.        EXAMPLE
  879.  
  880.                 seeSmtpConnect("mail.myisp.com",   // my SMTP server
  881.                                "<me@myisp.com>",   // my email address
  882.                                NULL);              // no Reply-To
  883.  
  884.                 seeSmtpConnect("mail.myisp.com",   // my SMTP server
  885.                                "<me@myisp.com>",   // my email address
  886.                                "<him@himisp.com>); // Reply-To address
  887.  
  888.       ALSO SEE  seeClose.
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      SEE4C Reference Manual                                    Page 15
  901.  
  902.  
  903.       +---------------+---------------------------------------------------+
  904.       | seeStatistics | Returns runtime statistics.                       |
  905.       +---------------+---------------------------------------------------+
  906.  
  907.  
  908.         SYNTAX  ULONG seeStatistics(
  909.                         int Index)   // Specifies which statistic.
  910.  
  911.        REMARKS  The seeStatistics function is used to return runtime
  912.                 statistics in the SEE DLL. The values of 'Index' are
  913.                 defined in SEE.H as follows:
  914.  
  915.                       SEE_GET_VERSION : Gets the SEE version number.
  916.                    SEE_GET_SOCK_ERROR : Gets last socket error.
  917.                       SEE_GET_COUNTER : Gets # times driver called.
  918.                      SEE_GET_RESPONSE : Gets last SMTP response code.
  919.  
  920.                 SEE_GET_MESSAGE_BYTES_READ : Gets # message bytes read.
  921.                  SEE_GET_ATTACH_BYTES_READ : Gets # attachment bytes read.
  922.                   SEE_GET_TOTAL_BYTES_READ : Gets total of above two.
  923.  
  924.                 SEE_GET_MESSAGE_BYTES_SENT : Gets # message bytes sent.
  925.                  SEE_GET_ATTACH_BYTES_SENT : Gets # attachment bytes sent.
  926.                   SEE_GET_TOTAL_BYTES_SENT : Gets total of above two.
  927.  
  928.                          SEE_GET_MSG_COUNT : Gets # emails waiting.
  929.                           SEE_GET_MSG_SIZE : Gets size of email.
  930.                       SEE_GET_BUFFER_COUNT : Gets # bytes in buffer for
  931.                                              seeGetEmailLines.
  932.  
  933.                 The number of message bytes sent will usually be larger
  934.                 than your message size because of SMTP protocol overhead.
  935.  
  936.                 The number of attachment bytes sent will be at least
  937.                 one-third larger than the actual attachment since every 3
  938.                 bytes are encoded as 4 7-bit ASCII bytes before being
  939.                 transmitted.
  940.  
  941.                 The purpose of "...BYTES_READ" and "...BYTES_SENT" is to
  942.                 provide the ability to track the transmission progress of
  943.                 large messages and attachments. See the READER example
  944.                 program.
  945.  
  946.        EXAMPLE
  947.  
  948.                 // get total message & attachment bytes transmitted.
  949.  
  950.                 Code = seeStatistics(SEE_GET_TOTAL_BYTES_SENT);
  951.  
  952.       ALSE SEE  seeDriver, seeIntegerParam, and seeStringParam.
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.      SEE4C Reference Manual                                    Page 16
  961.  
  962.  
  963.       +----------------+--------------------------------------------------+
  964.       | seeStringParam | Sets SEE string parameter.                       |
  965.       +----------------+--------------------------------------------------+
  966.  
  967.  
  968.         SYNTAX  int seeStringParam(
  969.                       int ParamName,      // Index of parameter.
  970.                       LPSTR ParamString)  // Parameter string.
  971.  
  972.        REMARKS  The seeStringParam function is used to set a string
  973.                 parameter as defined in SEE.H. For more information, refer
  974.                 to the Users Manual.
  975.  
  976.                 SEE_LOG_FILE : Specifies the log filename.
  977.  
  978.                 The log file is used to debug a SMTP session. Be advised
  979.                 that log files can be quite large. Don't use them unless
  980.                 necessary.
  981.  
  982.        EXAMPLE
  983.  
  984.                 seeStringParam(SEE_LOG_FILE, "mytest.log");
  985.  
  986.       ALSO SEE  seeIntegerParam.
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.      SEE4C Reference Manual                                    Page 17
  1021.  
  1022.  
  1023.       +-----------------+-------------------------------------------------+
  1024.       | seeVerifyFormat | Check email address format.                     |
  1025.       +-----------------+-------------------------------------------------+
  1026.  
  1027.  
  1028.         SYNTAX  int seeVerifyFormat(
  1029.                       LPSTR String)   // Email address to check.
  1030.  
  1031.        REMARKS  The seeVerifyFormat function is used to test an individual
  1032.                 email address for proper formatting. If this function
  1033.                 returns 0 or above, then the email address is properly
  1034.                 formatted. But, if this function returns a negative value,
  1035.                 the email address is either badly formatted, or it uses
  1036.                 characters (such as '%') that are not normally used as part
  1037.                 of an email address.
  1038.  
  1039.                 Note that left and right brackets ('<' and '>') must
  1040.                 surround the email address.
  1041.  
  1042.        EXAMPLE
  1043.  
  1044.                 static char Buffer[80];
  1045.  
  1046.                 . . .
  1047.  
  1048.                 Code = seeVerifyFormat("Billy E. Bob<beb@hisasp.com>");
  1049.                 if(Code<0)
  1050.                   {seeErrorText(Code,Buffer,80);
  1051.                    printf("Email address error : %s\n", Buffer);
  1052.                    exit(1);
  1053.                   }
  1054.  
  1055.       ALSO SEE  seeErrorText.
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.      SEE4C Reference Manual                                    Page 18
  1081.  
  1082.